package com.code.wflow.constants;

/**
 * @author ggh
 * @date 2022/10/26
 */
public enum ResultCode {
    SUCCESS("0", "成功"),

    PARAM_LACK("100100", "参数"),
    PARAM_ERROR("100101", "参数"),

    // 流程定义相关
    WORKFLOW_QUERY_ERROR("100201", "流程查询失败"),
    WORKFLOW_ADD_ERROR("100202", "流程新增失败"),
    WORKFLOW_NOT_EXIST("100207", "流程不存在"),

    // 流程实例相关
    INSTANCE_START_ERROR("100301", "发起流程失败"),
    INSTANCE_REVOKE_ERROR("100302", "撤销流程失败"),
    INSTANCE_QUERY_ERROR("100304", "查询流程申请失败"),
    INSTANCE_NOT_EXIST("100305", "流程申请不存在"),
    INSTANCE_DETAIL_QUERY_ERROR("100306", "查询流程申请详情失败"),
    INSTANCE_END("1003010", "流程已结束"),
    INSTANCE_NOT_START_OR_END("1003011", "流程未开始或已结束"),

    // 任务相关
    TASK_NOT_EXIST("100400", "任务不存在"),
    TASK_QUERY_ERROR("100401", "任务查询失败"),
    TASK_APPROVAL_ERROR("100402", "任务处理失败"),
    TASK_READ_ERROR("100403", "任务读取失败"),
    TASK_EXECUTOR_DISCREPANCY("100411", "不能执行该任务"),
    TASK_STATUS_DISCREPANCY("100412", "任务与所属状态不符"),

    // 节点相关
    NODE_TYPE_ERROR("100500", "节点类型错误"),
    NODE_NOT_ASSIGNED_USER("100500", "节点未设置指派人"),
    NODE_PROCESS_ERROR("100501", "该节点未开始或已结束"),

    // 表单相关
    FORM_QUERY_ERROR("100500", "表单查询失败");

    private String code;
    private String message;

    ResultCode(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return this.code;
    }

    public String getMessage() {
        return this.message;
    }

}
